package com.dissertation.respository;

import com.dissertation.model.Participant;
import com.dissertation.model.StudentParticipant;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;
import java.util.Optional;

public interface ParticipantRepository extends MongoRepository<Participant, String>{

    List<Participant> findAllByDeletedIsFalse();

    List<Participant> findAllByUniqueNameAndDeletedIsFalse(String name);

    StudentParticipant findByUniqueNameAndDeletedIsFalse(String name);

    Optional<Participant> findByUserIdAndDeletedIsFalse( String userId );
}
